<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>声明的方法</title>
  </head>
  <body>
    <script>
      // 普通函数声明
      function and1(a, b) {
        return a + b;
      }
      console.log(and1(1, 2));

      // 匿名函数表达式
      var and2 = function (a, b) {
        return a + b;
      };
      console.log(and2(1, 2));
      
      // 构造函数声明
      var and3 = new Function("a", "b", "return a+b");
      console.log(and3(1, 2));
    </script>
  </body>
</html>
